package com.lcm.oj.lanqiao.year2021.moni.c1;

import java.util.Scanner;

/**
 * @author Coder-lcm
 * @date 2021/4/17
 */
public class T6 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int d = scanner.nextInt();
        if (m == 2) {
            if (d <= 28) {
                System.out.println("yes");
            }else {
                System.out.println("no");
            }
        }else if (m == 4 || m == 6 || m == 9 || m == 11) {
            if (d <= 30) {
                System.out.println("yes");
            }else {
                System.out.println("no");
            }
        }else {
            if (d <= 31) {
                System.out.println("yes");
            }else {
                System.out.println("no");
            }
        }

    }
}
